package common

import (
	"github.com/asim/go-micro/v3/util/log"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"net/http"
	"strconv"
)

func PrometheusBoot(port int) {
	http.Handle("/metrics",promhttp.Handler())
	go func() {
		err:= http.ListenAndServe("0.0.0.0:"+ strconv.Itoa(port),nil)
		log.Info("start port")
		if err!=nil {
			log.Fatal(err)
		}
	}()
}